import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: () => import('../views/index.vue'),
    meta:{flag:true}
  },
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/index.vue'),
    meta:{flag:true}
  },
  {
    path: '/brand',
    name: 'brand',
    component: () => import('../views/brand.vue'),
    meta:{flag:true}
  },
  {
    path: '/shop',
    name: 'shop',
    component: () => import('../views/shop.vue'),
    meta:{flag:true}
  },
  {
    path: '/settle',    //立即购买后的结算页面
    name: 'settle',
    component: () => import('../views/settle.vue'),
    meta:{flag:false}
  },
  {
    path: '/settles', //结算页面
    name: 'settles',
    component: () => import('../views/settles.vue'),
    meta:{flag:false}
  },
  {
    path: '/PaymentSuccess',  //支付成功
    name: 'PaymentSuccess',
    component: () => import('../views/PaymentSuccess.vue'),
    meta:{flag:true}
  },
  {
    path: '/address',  //地址页
    name: 'address',
    component: () => import('../views/address.vue'),
    meta:{flag:true}
  },
  {
    path: '/addressedit',  //地址编辑
    name: 'addressedit',
    component: () => import('../views/addressedit.vue'),
    meta:{flag:false}
  },
  {
    path: '/addressAdd',  //地址添加
    name: 'addressAdd',
    component: () => import('../views/addressAdd.vue'),
    meta:{flag:false}
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/my.vue'),
    meta:{flag:true}
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue'),
    meta:{flag:false}
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/register.vue'),
    meta:{flag:false}
  },
  {
    path: '/quited',
    name: 'quited',
    component: () => import('../views/quited.vue'),
    meta:{flag:false}
  },
  {
    path: '/xq',
    name: 'xq',
    component: () => import('../views/xq.vue'),
    meta:{flag:false}
  }
]

const router = new VueRouter({
  routes
})

export default router
